<?php
/**
 # mod_jv_facelinker - JV FaceLinker
 # @version        1.7.x 
 # ------------------------------------------------------------------------
 # author    Open Source Code Solutions Co
 # copyright Copyright (C) 2011 joomlavi.com. All Rights Reserved.
 # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL or later.
 # Websites: http://www.joomlavi.com
 # Technical Support:  http://www.joomlavi.com/my-tickets.html
-------------------------------------------------------------------------*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

class jvFacebookLikebox
{
       public static $showlikebox;
       public static $url;
       public static $width;
       public static $height;
       public static $fans;
       public static $stream;
       public static $header;
       public static $position;
       public static $slide = ''; //default is Vertical   
       public static $noneSlide = false;
       public static $border;
       public static $icon = '';
       public static $iconLink;
        
       public function getInput($params)
       {
           $this->showlikebox = $params->get('l_likebox');
           if($params->get('l_url')){
              $this->url = str_replace(" ","",$params->get('l_url'));    
           }else{
              $this->url = "http://www.facebook.com/pages/Joomlavicom/100487240018744"; 
           }                 
           
           if((int)str_replace(" ","",$params->get('l_width')) >= 0){
              $this->width = (int)str_replace(" ","",$params->get('l_width'));   
           }else{
              $this->width = 190; 
           }
           
           if((int)str_replace(" ","",$params->get('l_height')) >= 0){
              $this->height = (int)str_replace(" ","",$params->get('l_height'));
           }else{
              $this->height = 340; 
           }
           
           if((int)str_replace(" ","",$params->get('l_show_fans')) >= 0){
              $this->fans = (int)str_replace(" ","",$params->get('l_show_fans'));
           }else{
              $this->fans = -(int)str_replace(" ","",$params->get('l_show_fans'));
           }
           
           if($params->get('l_show_stream')){
              $this->stream = 'true';
           }else{
              $this->stream = 'false'; 
           }
           
           if($params->get('l_show_header')){
              $this->header = 'true';  
           }else{
              $this->header = 'false'; 
           }
           
           //get position
           switch($params->get('l_position')){
                 case 0: 
                    $this->position = 'lefttop';    
                    break;     
                 case 1: 
                    $this->position = 'leftbottom'; 
                    break;     
                 case 2: 
                    $this->position = 'righttop';   
                    break;   
                 case 3: 
                    $this->position = 'rightbottom';   
                    break;   
                 default:
                    $this->position = 'default'; 
                    $this->icon = 'NONE'; //none set icon 
                    $this->noneSlide = true; //None slide
           }
           
           //get slide type
           if($params->get('l_slide') == 0){
               $this->slide = ", {mode: 'horizontal'}";    //Horizontal 
           }
             
           //get border
           if($params->get('l_show_border')){
               $this->border = '';
           }else{
               $this->border = 'NONE';
           }
           
           //get icon link
           if($params->get('l_icon_link')){
               $this->iconLink = $params->get('l_icon_link');
           }else{
               $this->iconLink = 'http://facebook.com/pages/Joomlavicom/100487240018744';
           }
          
       }  
  
}

//
class jvFacebookLivestream
{
       public static $showlivestream;
       public static $app_id;
       public static $width;
       public static $height;
       public static $x_id;
       public static $postfriend; 
       public static $position;
       public static $slide = ''; //default is Vertical   
       public static $noneSlide = false;
       public static $border;
       public static $icon = '';  
       public static $iconLink;
                      
       public function getInput($params)
       {  
           $this->showlivestream = $params->get('s_livestream');
           if($params->get('s_appid')){
              $this->app_id = str_replace(" ","",$params->get('s_appid'));    
           }else{
              $this->app_id = '8331309681'; 
           }                 
           
           if((int)str_replace(" ","",$params->get('s_width')) >= 0){
              $this->width = (int)str_replace(" ","",$params->get('s_width'));   
           }else{
              $this->width = 190; 
           }
           
           if((int)str_replace(" ","",$params->get('s_height')) >= 0){
              $this->height = (int)str_replace(" ","",$params->get('s_height'));
           }else{
              $this->height = 300; 
           }
           
           //
           switch($params->get('s_position')){
                 case 0: 
                    $this->position = 'lefttop';    
                    break;     
                 case 1: 
                    $this->position = 'leftbottom'; 
                    break;     
                 case 2: 
                    $this->position = 'righttop';   
                    break;   
                 case 3: 
                    $this->position = 'rightbottom';   
                    break;   
                 default:
                    $this->position = 'default';
                    $this->icon = 'NONE'; //none set icon 
                    $this->noneSlide = true; //None slide
           }
           
           //get slide type
           if($params->get('s_slide') == 0){
               $this->slide = ", {mode: 'horizontal'}";    //Horizontal 
           }
           
           //
           if($params->get('s_xid')){
              $this->x_id = str_replace($params->get('s_xid'));
           }else{
              $this->x_id = 'default';
           }
           
           if($params->get('s_postfriend')){
              $this->postfriend = 'true';
           }else{
              $this->postfriend = 'false'; 
           }
           
           //get border
           if($params->get('s_show_border')){
               $this->border = '';
           }else{
               $this->border = 'NONE';
           }
           
           //get icon link
           if($params->get('s_icon_link')){
               $this->iconLink = $params->get('s_icon_link');
           }else{
               $this->iconLink = 'http://facebook.com/pages/Joomlavicom/100487240018744';
           }
           
       }    
}

